load("@fbsource//tools/build_defs:rust_library.bzl", "rust_library")

oncall("build_infra")

rust_library(
    name = "buck2_common",
    srcs = glob(
        ["src/**/*.rs"],
    ),
    os_deps = [
        (
            "linux",
            [
                "fbsource//third-party/rust:hyper-util",
                "fbsource//third-party/rust:nix",
                "fbsource//third-party/rust:tower",
                "fbsource//third-party/rust:xattr",
            ],
        ),
        (
            "macos",
            [
                "fbsource//third-party/rust:hyper-util",
                "fbsource//third-party/rust:nix",
                "fbsource//third-party/rust:tower",
                "fbsource//third-party/rust:xattr",
            ],
        ),
    ],
    test_deps = [
        "fbsource//third-party/rust:assert_matches",
        "fbsource//third-party/rust:indoc",
        "fbsource//third-party/rust:tempfile",
        "fbsource//third-party/rust:test-case",
        "fbsource//third-party/rust:triomphe",
    ],
    deps = [
        "fbsource//third-party/rust:anyhow",
        "fbsource//third-party/rust:async-scoped",
        "fbsource//third-party/rust:async-trait",
        "fbsource//third-party/rust:blake3",
        "fbsource//third-party/rust:bytes",
        "fbsource//third-party/rust:chrono",
        "fbsource//third-party/rust:compact_str",
        "fbsource//third-party/rust:dashmap",
        "fbsource//third-party/rust:derivative",
        "fbsource//third-party/rust:derive_more",
        "fbsource//third-party/rust:digest",
        "fbsource//third-party/rust:dirs",
        "fbsource//third-party/rust:fs4",
        "fbsource//third-party/rust:futures",
        "fbsource//third-party/rust:globset",
        "fbsource//third-party/rust:hex",
        "fbsource//third-party/rust:hyper-1-5-1",
        "fbsource//third-party/rust:indexmap",
        "fbsource//third-party/rust:itertools",
        "fbsource//third-party/rust:num_enum",
        "fbsource//third-party/rust:once_cell",
        "fbsource//third-party/rust:parking_lot",
        "fbsource//third-party/rust:prost-types-0-13-4",
        "fbsource//third-party/rust:rand",
        "fbsource//third-party/rust:ref-cast",
        "fbsource//third-party/rust:regex",
        "fbsource//third-party/rust:rusqlite",
        "fbsource//third-party/rust:serde",
        "fbsource//third-party/rust:serde_json",
        "fbsource//third-party/rust:sha1",
        "fbsource//third-party/rust:sha2",
        "fbsource//third-party/rust:smallvec",
        "fbsource//third-party/rust:strsim",
        "fbsource//third-party/rust:tokio",
        "fbsource//third-party/rust:tonic-0-12-3",
        "fbsource//third-party/rust:tracing",
        "//buck2/allocative/allocative:allocative",
        "//buck2/app/buck2_cli_proto:buck2_cli_proto",
        "//buck2/app/buck2_core:buck2_core",
        "//buck2/app/buck2_data:buck2_data",
        "//buck2/app/buck2_error:buck2_error",
        "//buck2/app/buck2_events:buck2_events",
        "//buck2/app/buck2_fs:buck2_fs",
        "//buck2/app/buck2_http:buck2_http",
        "//buck2/app/buck2_util:buck2_util",
        "//buck2/app/buck2_wrapper_common:buck2_wrapper_common",
        "//buck2/dice/dice:dice",
        "//buck2/dice/dice_futures:dice_futures",
        # @oss-disable[end= ]: "//buck2/facebook/allocator-stats:allocator-stats",
        "//buck2/gazebo/cmp_any:cmp_any",
        "//buck2/gazebo/dupe:dupe",
        "//buck2/gazebo/gazebo:gazebo",
        "//buck2/starlark-rust/starlark_map:starlark_map",
        # @oss-disable[end= ]: "//common/rust/folly/logging:logging",
        # @oss-disable[end= ]: "//common/rust/folly/memory:memory",
        # @oss-disable[end= ]: "//common/rust/gflags:gflags",
        "//common/rust/shed/fbinit:fbinit",
        # @oss-disable[end= ]: "//common/rust/shed/hostcaps:hostcaps",
    ],
)
